package com.neo.impatient.C13_Collection.C13_13Streams

object StreamsTest {


  def numsFrom(n: BigInt): Stream[BigInt] = n #:: numsFrom(n + 1)

  def main(args: Array[String]): Unit = {

    val tenOrMore = numsFrom(10)
    println(tenOrMore)
    println(tenOrMore.tail.tail.tail)
    println(tenOrMore.tail.tail.tail.tail)

    val squares = numsFrom(1).map(x => x * x)

    println(squares)
    println(squares.take(100).force)
  }
}
